-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(bigquery): add tests for concatenating categorical columns #10180
Conversation
@tswast Friendly ping. :) This PR is probably something than can be reviewed and closed quickly (read: before the repo split tomorrow). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
bqstorage_client=bqstorage_client, | ||
dtypes={ | ||
"col_category": pandas.core.dtypes.dtypes.CategoricalDtype( | ||
categories=["low", "medium", "high"], ordered=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[no action required] I suspect there will be users who don't necessarily know the categories ahead of time, though this could trivially be done with a group by / distinct query. If we had a support cookbook, I'd say we should add this info there.
Closes #8044.
This PR adds tests for concatenating multiple-page results that contain categorical column data (both with or without
pyarrow
available).It appears that the code already works, provided that a correct explicit categorical
dtype
is passed toto_dataframe()
method.If
dtypes
are not specified, a default pandas concatenating behavior results in categorical columns ending up with the dtype "object", but that's already explained in thedtypes
parameter's docstring, meaning that the code behaves as advertised.PR checklist